Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

YouTube tag enhancement

Options
  • 24-12-2008 10:27am
    #1
    Closed Accounts Posts: 17,208 ✭✭✭✭


    Given the prevalence of people posting the full video link in the YouTube tag (as may other link tags like [noparse]noparse] have taught them to do), would it be possible to extend the YouTube tag to parse out everything but the actual video code itself?  Should be able to drop everything pre v= and post the optional & marks.


Comments

  • Subscribers Posts: 4,075 ✭✭✭IRLConor


    Given the prevalence of people posting the full video link in the YouTube tag (as may other link tags like [noparse]noparse] have taught them to do), would it be possible to extend the YouTube tag to parse out everything but the actual video code itself?  Should be able to drop everything pre v= and post the optional & marks.

    Something like this would do it (untested):

    [PHP]
    function parse_youtube_link($url) {
    if (preg_match("/[&?]v=(.*?)[&?]/", $url, $matches)) {
    if ($matches[1]) {
    return matches[1];
    }
    }
    return NULL;
    }
    [/PHP]

    You'd probably have to hack vBulletin to do it though since the custom BBCode manager in vBulletin only allows simple find and replace.


Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.

Advertisement